package com.sskj.trafficcontrol.service.impl;

import com.sskj.trafficcontrol.dao.TcUserDAO;
import com.sskj.trafficcontrol.model.param.LoginParam;
import com.sskj.trafficcontrol.model.pojo.TcUser;
import com.sskj.trafficcontrol.service.AccountService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author : zhao kuo
 * @date : 2019/1/29 22:14
 * @description :
 */
@Service
public class AccountServiceImpl implements AccountService {

    @Autowired
    private TcUserDAO tcUserDAO;

    @Override
    public TcUser login(LoginParam loginParam) {

        TcUser user = new TcUser();
        BeanUtils.copyProperties(loginParam,user);

        return (tcUserDAO.checkLogin(user)==null)?null:tcUserDAO.checkLogin(user);
    }
}
